package com.steak.elasticsearch.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "item",type = "docs", shards = 1, replicas = 0)
@Data
@AllArgsConstructor //全参构造函数
public class Item {
    @Id
    private int id;

    @Field(type = FieldType.Keyword)
    private String title; //标题

    @Field(type = FieldType.Keyword)
    private String category;//分类

    @Field(type = FieldType.Keyword)
    private String brand; //品牌

    @Field(type = FieldType.Double)
    private Double price; //价格

    @Field(type = FieldType.Keyword)
    private String images; //图片地址

}
